<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>原型链检测之object.isPrototypeOf</title>
</head>
<body>
    <script>
        let a = {};
        let b = {};
        // b.isPrototypeof(a)   判断b是否在a的原型链上
        console.log(b.isPrototypeOf(a));
        console.log(Object.prototype.isPrototypeOf(a));
        console.log(b.__proto__.isPrototypeOf(a));

        Object.setPrototypeOf(a,b);
        console.log(b.isPrototypeOf(a));

        let c = {};
        Object.setPrototypeOf(b,c);
        console.log(c.isPrototypeOf(a));
        console.log(c.isPrototypeOf(b));
    </script>
</body>
</html>